<template>
	<view class="main">
		<view class="active_tit">
			<view class="tit">
				其他联系人
			</view> 
			<view class="add" @click="add">
				＋
			</view>
		</view>
		<!-- input -->
		<view v-for="(item,index) in stdOffsurIndRelation" :key='index'>
			<view class="cut">联系人{{index+1}}<uni-icons class="clear" type="clear" @click='stdDel(stdOffsurIndRelation,item,"stdOffsurIndRelation")'></uni-icons></view>
			<view class="main">
				<ActiveForm required  ref='relName'>
					<view class="active_label">
						姓名：
					</view>
					<view class="active_input">
						<input type="text" v-model="item.relName" />
					</view>
				</ActiveForm>
				<ActiveForm required  ref='relPhone'>
					<view class="active_label">
						电话：
					</view>
					<view class="active_input">
						<input type="number" v-model="item.relPhone"  maxlength="11" />
					</view>
				</ActiveForm>
				<ActiveForm required  ref='relationship'>
					<view class="active_label">
						关系：
					</view>
					<view class="active_input">
						<SelectPicker v-model="item.relationship" :options="relationshipOptions" placeholder="请选择" />
						<!-- <input type="text" v-model="item.relationship" /> -->
					</view>
				</ActiveForm>
			</view>
		</view>
		<!-- <button type="default" @click="getForm">getForm</button> -->
	</view>
</template>

<script>
	import SelectPicker from "../../SelectPicker";
	import RegionPicker from "../../RegionPicker";
	import region from '../areaList.js'
	export default {
		name: 'otherContacts',
		data() {
			return {
				region,
				province: "",
				city: "",
				county: "",
				index: 1,
				listNum:1,
				stdOffsurIndRelation:[],
				relationshipOptions:[],
			}
		},
		components: {
			SelectPicker,
			RegionPicker

		},
		mounted() {
			//获取返显数据
			setTimeout(()=>{    
				//数据反显
				this.stdOffsurIndRelation = getApp().globalData.stdOffsurIndRelation
				this.relationshipOptions= getApp().globalData.optType.REL
			},getApp().globalData.timeout)
		},
		watch:{
			stdOffsurIndRelation:{
				handler:function(res){
					//console.warn('stdOffsurIndRelation组件数据变化',res)
					getApp().globalData.stdOffsurIndRelation = res
				},
				deep:true
			}
		},
		methods:{
			getForm(){
				
			},
			getArea(res){
				
			},
			add(){
				this.stdOffsurIndRelation.push(
					{
						businessId: "", //业务申请流水号
						createTime: "", //创建时间
						createUser: "", //创建人
						customerId: "", //客户编号
						customerSystemId: "", //客户系统编号
						deleteFlag: "", //删除标志
						entityRoleType: "", //数据归属类型
						getDatTime: "", //数据加载时间
						imageUrl: "", //影像路径
						relName: "", //联系人姓名
						relPhone: "", //联系人电话
						relationship: "03", //联系人关系
						reqId: "", //业务申请序号
						sourceSystem: "", //数据来源系统
						updateTime: "", //更新时间
						updateUser: "", //更新人
						uuid: "" //uuid
					}
				)
			}
		}
	}
</script>

<style lang="scss">
	
	
</style>

